package com.egg.common.core.enums;

import com.egg.common.swagger.annotation.SwaggerDisplayAnnotation;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Http接口请求返回状态码
 * -- 通过in18进行翻译
 *
 * @author east
 */
@Getter
@SwaggerDisplayAnnotation
@AllArgsConstructor
public enum ResponseCode {


    SUCCESS(2000, "请求成功"),
    SECRET_ERROR(3000, "加解密秘钥异常"),
    SYSTEM_ERROR(4000, "服务器异常"),
    PARAM_INVALID(5000, "参数无效"),
    PARAM_MISSING(5001, "参数缺失"),
    FALLBACK_ERROR(6000, "突然,有点小累..."),
    CUSTOM_ERROR(9000, "抛出消息内容"),
    ;

    private Integer code;
    private String message;

    @Override
    public String toString() {
        return message + ":" + code;
    }
}
